package com.bwie.utils;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;

/**
 * @description : TODO
 * @Author QiHainan
 * @Create 2025/7/19 10:53
 * @Version 1.0
 */
public class TokenUtil {
    public static Integer userId(String token){
        Claims body = Jwts.parser().setSigningKey("123456").parseClaimsJws(token).getBody();
        return body.get("userId",Integer.class);
    }

    public static String userName(String token){
        Claims body = Jwts.parser().setSigningKey("123456").parseClaimsJws(token).getBody();
        return body.get("userName",String.class);
    }
}
